# # -*- coding: utf-8 -*-
# # @Time    : 2021/3/31 10:41
# # @Author  : xxue
# # @Email   : x_xue1212@163.com
# # @File    : 3-31python函数作业.py
# # @Software: PyCharm
#


import os
import os.path
def tree1(filepath: str, depth: int):
    if depth == 0:
        print(os.path.abspath(filepath))
    pathlist = os.listdir(filepath)

    for i in pathlist:
        filepath2 = filepath
        filepath2 += '/'
        filepath2 += i
        if os.path.isfile(filepath2):
            print("|  " * depth + "|___" + i)
        elif os.path.isdir(filepath2):
            print("|  " * depth + "|___" + i)

            tree1(filepath2, depth+1)
path = os.getcwd()
tree1(path,0)
